<template>
	<view class="">
		<u-tabbar
		  :value="index"
		  @change="handleChange"
		  activeColor="#333"
		>
		  <u-tabbar-item text="首页">
		    <image
		      class="u-page__item__slot-icon"
		      slot="active-icon"
		      src="/static/tabbar_active_1.png"
		    ></image>
		    <image
		      class="u-page__item__slot-icon"
		      slot="inactive-icon"
		      src="/static/tabbar_1.png"
		    ></image>
		  </u-tabbar-item>
		   
		  
		  <u-tabbar-item text="悦颜">
		    <image
		      class="u-page__item__slot-icon"
		      slot="active-icon"
		      src="/static/tabbar_active_2.png"
		    ></image>
		    <image
		      class="u-page__item__slot-icon"
		      slot="inactive-icon"
		      src="/static/tabbar_2.png"
		    ></image>
		  </u-tabbar-item>
		  
		  <u-tabbar-item text="购票">
		    <image
		      class="u-page__item__slot-icon"
		      slot="active-icon"
		      src="/static/tabbar_active_3.png"
		    ></image>
		    <image
		      class="u-page__item__slot-icon"
		      slot="inactive-icon"
		      src="/static/tabbar_3.png"
		    ></image>
		  </u-tabbar-item>
		  
		  <u-tabbar-item text="购物袋">
		    <image
		      class="u-page__item__slot-icon"
		      slot="active-icon"
		      src="/static/tabbar_active_4.png"
		    ></image>
		    <image
		      class="u-page__item__slot-icon"
		      slot="inactive-icon"
		      src="/static/tabbar_4.png"
		    ></image>
		  </u-tabbar-item>
		  
		  <u-tabbar-item text="我的">
		    <image
		      class="u-page__item__slot-icon"
		      slot="active-icon"
		      src="/static/tabbar_active_5.png"
		    ></image>
		    <image
		      class="u-page__item__slot-icon"
		      slot="inactive-icon"
		      src="/static/tabbar_5.png"
		    ></image>
		  </u-tabbar-item>
		  
		 
		</u-tabbar>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				value4: 0,
			}
		},
		props:{
			index:{
				type:Number,
				default: 0, 
			}
		},
		methods:{
			handleChange(e){ 
				if(e == 0){
					uni.switchTab({
						url:"/pages/index/index"
					})
				}else if(e == 1){
					
				}else if(e == 2){
					
					uni.navigateTo({
						url:"/pagesA/activity/index"
					})
				}else if(e == 3){
					if(uni.getStorageSync('token')){
						uni.switchTab({
							url:"/pages/bags/index"
						})
					}else{
						uni.reLaunch({
							url:"/pages/user/login"
						})
					}
				}else if(e == 4){
					uni.switchTab({
						url:"/pages/user/index"
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.u-page__item__slot-icon{
		width: 54rpx;
		height: 54rpx;
	}
</style>